extends PlayStatusInterface

# 物理桢，处理碰撞的逻辑
func run_physics_process(_delta):
	var collision_info = owner.move_and_collision_info()
	if collision_info.get("is_on_floor"):
		if owner.velocity.x == 0:
			manage_node.to_idle()
		else:
			manage_node.to_walk()
		return
	
	# 墙上时刻
	#if owner.is_collision_wall():
		#manage_node.to_onwall()
		#return 
					
	# 头顶时刻
	if collision_info.get("was_on_celling") && not collision_info.get("is_on_celling"):
		manage_node.to_fall()
		return
	
			
# 逻辑桢，处理画面的逻辑
func run_process(delta):	
	if owner.can_jump_from_celling()>0:
		# 从天花板上
		manage_node.to_fall()
	else:
		# 从天花板走动
		owner.walk_from_celling()
	if owner.get_velocity().x != 0:
		owner.show_animiation("celling_walk")
	else:
		owner.show_animiation("celling_wait")
